package com.qkl.xiatang.app.config;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.Base64;

@Component
@Data
@Slf4j
public class AppConfig {

    @Value("${mqtt.enable}")
    private boolean mqttEnable;

    @Value("${mqtt.broker}")
    private String mqttBroker;

    @Value("${mqtt.subTopic}")
    private String mqttSubTopic;

    @Value("${mqtt.clientId}")
    private String mqttClientId;

    @Value("${mqtt.userName}")
    private String mqttUserName;

    @Value("${mqtt.pwd}")
    private String mqttPwd;

    @Value("${server.servlet.context-path}")
    private String serverContextPath;

    @Value("${app.aesSecret}")
    private String appAesSecret;

    @Value("${aliyun.oss.accessKey}")
    private String aliyunOssAccessKey;

    @Value("${aliyun.oss.secretKey}")
    private String aliyunOssSecretKey;

    @Value("${aliyun.oss.endpoint}")
    private String aliyunOssEndpoint;

    @Value("${aliyun.oss.bucketName}")
    private String aliyunOssBucketName;

    @Value("${weather.url}")
    private String weatherUrl;

    @Value("${weather.key}")
    private String weatherKey;

    @Value("${app.channelRefresh}")
    private boolean channelRefresh;

}
